package com.sk.bilibili.view.fragment.member;

import com.alibaba.android.vlayout.DelegateAdapter;
import com.sk.bilibili.adapter.vlayout.member.VideoSetAdapter;
import com.sk.bilibili.bean.VideoSet;
import com.sk.bilibili.model.fragment.member.DynamicModel;
import com.sk.bilibili.model.fragment.member.VideoSetModel;
import com.sk.bilibili.view.activity.VideoSetActivity;
import com.sk.bilibili.view.diy.bottomDialog.LaterBottomDialog;
import com.sk.bilibili.view.fragment.BaseListFragment;
import com.sk.bilibili.view.fragment.main.LaterFragment;

import java.util.List;

public class VideoSetFragment extends BaseListFragment<VideoSetModel> {

    private VideoSetAdapter videoSetAdapter;
    private Integer memberId;
    private LaterBottomDialog laterBottomDialog;

    public VideoSetFragment(Integer memberId) {
        this.memberId=memberId;
        laterBottomDialog=new LaterBottomDialog();
    }

    @Override
    protected void afterSetView() {
        super.afterSetView();
        model.loadVideoSet(memberId);
    }

    @Override
    protected void initAdapter(DelegateAdapter adapter) {
        videoSetAdapter = new VideoSetAdapter(getContext(), this);
        adapter.addAdapter(videoSetAdapter);
    }

    public void onVideoSetClick(Integer id) {
        VideoSetActivity.start(getContext(),id);
    }

    public void loadSuccess(List<VideoSet> list) {
        videoSetAdapter.setData(list);
    }

    public void onMoreClick(Integer id) {
        laterBottomDialog.show(getChildFragmentManager(),id);
    }

}